<template>
  <div class="con">
    <div class="echarts" id="quality7Echarts"></div>
  </div>
</template>
  
  <script>
export default {
  name:'qualityArea7',
  data() {
    return {
      option: {
        color: ["#80FFA5", "#ffc23d", "#37A2FF"],
        title: {
          // text: "问题趋势",
          // textStyle:{
          //   color:'#ccc',
          //   fontWeight:'normal',
          //   fontSize:'16px',
          //   fontFamily:'Microsoft YaHei'
          // },
        },
        tooltip: {
          trigger: "axis",
          axisPointer: {
            type: "cross",
            label: {
              backgroundColor: "#6a7985",
            },
          },
        },
        legend: {
          data: ["一般隐患", "严重隐患", "重大隐患"],
          top: "15px",
          icon: "circle",
          textStyle: {
            color: "#ccc",
          },
        },
        grid: {
          left: "3%",
          right: "4%",
          bottom: "3%",
          containLabel: true,
        },
        xAxis: [
          {
            type: "category",
            boundaryGap: false,
            data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
          },
        ],
        yAxis: [
          {
            type: "value",
          },
        ],
        series: [
          {
            name: "一般隐患",
            type: "line",
            stack: "Total",
            smooth: true,
            lineStyle: {
              width: 0,
            },
            showSymbol: false,
            areaStyle: {
              opacity: 0.8,
              color: {
                type: "linear",
                x: 0,
                y: 0,
                x2: 0,
                y2: 1,
                colorStops: [
                  // 渐变颜色
                  {
                    offset: 0,
                    color: "#ffad08",
                  },
                  {
                    offset: 0.4,
                    color: "#ff8c66",
                  },
                  {
                    offset: 0.9,
                    color: "#ffbda1",
                  }
                ],
                global: false,
              },
            },
            emphasis: {
              focus: "series",
            },
            data: [14, 23, 10, 26, 9, 34, 25],
          },
          {
            name: "严重隐患",
            type: "line",
            stack: "Total",
            smooth: true,
            lineStyle: {
              width: 0,
            },
            showSymbol: false,
            areaStyle: {
              opacity: 0.8,
              color: {
                type: "linear",
                x: 0,
                y: 0,
                x2: 0,
                y2: 1,
                colorStops: [
                  // 渐变颜色
                  {
                    offset: 0.1,
                    color: "#c55D34", // 0% 处的颜色
                  },{
                    offset: 0.4,
                    color: "#c58168", // 0% 处的颜色
                  },
                  {
                    offset: 0.9,
                    color: "#c5988c", // 100% 处的颜色
                  },
                ],
                global: false,
              },
            },
            emphasis: {
              focus: "series",
            },
            data: [12, 28, 11, 23, 22, 34, 31],
          },
          {
            name: "重大隐患",
            type: "line",
            stack: "Total",
            smooth: true,
            lineStyle: {
              width: 0,
            },
            showSymbol: false,
            areaStyle: {
              opacity: 0.8,
              color: {
                type: "linear",
                x: 0,
                y: 0,
                x2: 0,
                y2: 1,
                colorStops: [
                  // 渐变颜色
                  {
                    offset: 0,
                    color: "#458fff",
                  },{
                    offset: 0.4,
                    color: "#8cadff",
                  },{
                    offset: 0.9,
                    color: "#bfcfff",
                  }
                ],
                global: false,
              },
            },
            emphasis: {
              focus: "series",
            },
            data: [32, 13, 20, 33, 19, 13, 22],
          },
        ],
      },
    };
  },
  methods: {},
  mounted() {
    setTimeout(() => {
      const myCharts = this.$echarts.init(
        document.getElementById("quality7Echarts")
      );
      myCharts.setOption(this.option);
    }, 500);
  },
};
</script>
  
  <style lang="scss" scoped>
.con {
  .echarts {
    width: 860px;
    height: 235px;
  }
}
</style>